#pragma once

#include "GlobalDefines.h"

class WSInputManager : public WSObject
{
public:
	WSInputManager();
	virtual ~WSInputManager();

	static WSInputManager * Instance()
	{
		static WSInputManager instance;
		return &instance;
	}

	virtual void Initialize();
	virtual void Destroy();

public:

	void update();

	bool IsKeyDown(char key) { return (mKeyboardState[key] & 0x80) != 0; }
	bool IsMouseBtnDown(int btn) { return (mMouseState.rgbButtons[btn] & 0x80) != 0; }

	const DIMOUSESTATE2 GetMouseState() { return mMouseState; }

private:
	LPDIRECTINPUT8 mDirectInput;

	LPDIRECTINPUTDEVICE8 mKeyboardDevice;
	char mKeyboardState[256];

	LPDIRECTINPUTDEVICE8 mMouseDevice;
	DIMOUSESTATE2 mMouseState;
};